package cn.fz.ssedemo.controller;

import cn.fz.ssedemo.domain.dto.AlarmEventDto;
import cn.fz.ssedemo.domain.vo.ResultVO;
import cn.fz.ssedemo.service.AlarmService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("alarm")
@RestController
@Tag(name = "报警模块",description = "报警模块")
@RequiredArgsConstructor
public class AlarmController {
    private  final AlarmService alarmService;

    @Operation(summary = "新增报警")
    @PostMapping("add")
    public ResultVO<String> add(@RequestBody AlarmEventDto eventDto){
        alarmService.saveAlarm(eventDto);
        return ResultVO.success();
    }
}
